package com.arctan.mhxy_utils_android.utils;

import android.text.TextUtils;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
import java.util.TimeZone;

/**
 * Created by Kliven on 2017/5/4.
 */
public class DateUtil {
    public static long str2Long(String strTime,String format) throws Exception{
        SimpleDateFormat formatter= new SimpleDateFormat(format);
        Date date = null;
        date = formatter.parse(strTime);
        return date.getTime();
    }
    public static String long2Str(long datetime,String format) {
        SimpleDateFormat sdf = new SimpleDateFormat(format, Locale.getDefault());
        return sdf.format(new Date(datetime));

    }
}
